package my.design.state;

/**
 * @author zp
 * @version 1.0
 * @description: 开启活动类
 * @date 2022/10/30 16:51
 */
public class OpenState extends State {
    private final ActivityService activityService;

    public OpenState(ActivityService activityService) {
        this.activityService = activityService;
    }

    @Override
    public Result arraignment(Enum<Status> currentStatus) {

        return new Result("0001", "活动开启状态不可提审");
    }

    @Override
    public Result checkPass(Enum<Status> currentStatus) {
        return new Result("0001", "活动开启不可审核通过");
    }

    @Override
    public Result checkRefuse(Enum<Status> currentStatus) {
        return new Result("0001", "活动开启不可审核拒绝");
    }

    @Override
    public Result checkRevoke(Enum<Status> currentStatus) {
        return new Result("0001", "活动开启不可撤销审核");
    }

    @Override
    public Result close(Enum<Status> currentStatus) {
        activityService.getActivityInfo().setStatus(Status.Open);
        return new Result("0000", "活动关闭成功");
    }

    @Override
    public Result open(Enum<Status> currentStatus) {
        return new Result("0001", "活动已开启无法重复开启");
    }

    @Override
    public Result doing(Enum<Status> currentStatus) {
        return new Result("0001", "活动开启中活动不可执行活动中变更");
    }
}
